<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ page contentType="text/html; charset=iso-8859-1" language="java" errorPage="" %>
<% int topMenu = 182; %>
<script type="text/javascript">
<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function changeName ( name, newName ) {
	var element = document.getElementById ( name );
	element.id = element.name = newName
}

function getLeftMenu ( ) {
  return ((document.body.clientWidth / 2) | 0 ) + 141 - 500;
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<script type="text/javascript" src="js/menu.js"></script>
<link href="css/menu.css" rel="stylesheet" type="text/css" />
<form id="form1" name="form1" method="post" action="validarUsuario.do">
  <table border="0" cellpadding="0" cellspacing="0" width="141" background="img/template_r14_c1.gif">
    <tr>
      <td><img src="img/spacer.gif" width="9" height="1" border="0" alt="" /></td>
      <td><img src="img/spacer.gif" width="4" height="1" border="0" alt="" /></td>
      <td><img src="img/spacer.gif" width="16" height="1" border="0" alt="" /></td>
      <td><img src="img/spacer.gif" width="6" height="1" border="0" alt="" /></td>
      <td><img src="img/spacer.gif" width="5" height="1" border="0" alt="" /></td>
      <td><img src="img/spacer.gif" width="4" height="1" border="0" alt="" /></td>
      <td><img src="img/spacer.gif" width="13" height="1" border="0" alt="" /></td>
      <td><img src="img/spacer.gif" width="26" height="1" border="0" alt="" /></td>
      <td><img src="img/spacer.gif" width="14" height="1" border="0" alt="" /></td>
      <td><img src="img/spacer.gif" width="4" height="1" border="0" alt="" /></td>
      <td><img src="img/spacer.gif" width="4" height="1" border="0" alt="" /></td>
      <td><img src="img/spacer.gif" width="6" height="1" border="0" alt="" /></td>
      <td><img src="img/spacer.gif" width="17" height="1" border="0" alt="" /></td>
      <td><img src="img/spacer.gif" width="3" height="1" border="0" alt="" /></td>
      <td><img src="img/spacer.gif" width="10" height="1" border="0" alt="" /></td>
      <td><img src="img/spacer.gif" width="1" height="1" border="0" alt="" /></td>
    </tr>
  <tr>
   <td colspan="17"><img name="menu_r14_c1" src="img/menu_r2_c1.gif" width="141" height="28" border="0" id="menu_r14_c1" alt="" /></td>
   <td><img src="img/spacer.gif" width="1" height="28" border="0" alt="" /></td>
  </tr>
  <tr>
   <td colspan="7" valign="top"><p style="margin:0px"></p></td>
   <td colspan="3"><a href="index.jsp" onMouseOut="MM_swapImgRestore();" onMouseOver="MM_swapImage('menu_r15_c8','','img/menu_r15_c8_f2.gif',1);"><img name="menu_r15_c8" src="img/menu_r15_c8.gif" width="35" height="12" border="0" id="menu_r15_c8" alt="" /></a></td>
   <td colspan="7" valign="top"><p style="margin:0px"></p></td>
   <td><img src="img/spacer.gif" width="1" height="12" border="0" alt="" /></td>
  </tr>
    <c:if test="${user != null}" >
      <c:forEach var="modulo" items="${sessionScope.modulos}">
        <c:if test="${modulo.id == 4}" >
          <tr>
            <td colspan="15"><img name="menu_r2_c1" src="img/menu_r2_c1.gif" width="141" height="14" border="0" id="menu_r2_c1" alt="" /></td>
            <td><img src="img/spacer.gif" width="1" height="14" border="0" alt="" /></td>
          </tr>
          <tr onMouseOut="startTimeout(1000);" onMouseOver="showMenu('menu', 'submenu_0<c:out value="${modulo.id}" />',getLeftMenu(),<%= topMenu %>,'submennu_r3_c1');">
            <td colspan="5" valign="top"><p style="margin:0px"></p></td><% topMenu += 15 + 14; %>
            <td colspan="5"><a href="submenu.do?modulo=4" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('menu_r1_c61','','img/menu_r1_c6_f2.gif',1)"><img name="menu_r1_c61" src="img/menu_r1_c6.gif" width="61" height="15" border="0" id="menu_r1_c61" alt="" /></a></td>
            <td colspan="5" valign="top"><p style="margin:0px"></p></td>
            <td><img src="img/spacer.gif" width="1" height="15" border="0" alt="" /></td>
          </tr>
        </c:if>
        <c:if test="${modulo.id == 3}" >
          <tr>
            <td colspan="15"><img name="menu_r2_c1" src="img/menu_r2_c1.gif" width="141" height="14" border="0" id="menu_r2_c1" alt="" /></td>
            <td><img src="img/spacer.gif" width="1" height="14" border="0" alt="" /></td>
          </tr>
          <tr onMouseOut="startTimeout(1000);" onMouseOver="showMenu('menu', 'submenu_0<c:out value="${modulo.id}" />',getLeftMenu(),<%= topMenu %>,'submennu_r3_c1');">
            <td colspan="3" valign="top"><p style="margin:0px"></p></td>
            <td colspan="9"><a href="submenu.do?modulo=3" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('menu_r3_c4','','img/menu_r3_c4_f2.gif',1);"><img name="menu_r3_c4" src="img/menu_r3_c4.gif" width="82" height="12" border="0" id="menu_r3_c4" alt="" /></a></td><% topMenu += 12 + 14; %>
            <td colspan="3" valign="top"><p style="margin:0px"></p></td>
            <td><img src="img/spacer.gif" width="1" height="12" border="0" alt="" /></td>
          </tr>
        </c:if>
        <c:if test="${modulo.id == 5}" >
          <tr>
            <td colspan="15"><img name="menu_r4_c1" src="img/menu_r4_c1.gif" width="141" height="15" border="0" id="menu_r4_c1" alt="" /></td>
            <td><img src="img/spacer.gif" width="1" height="15" border="0" alt="" /></td>
          </tr>
          <tr onMouseOut="startTimeout(1000);" onMouseOver="showMenu('menu', 'submenu_0<c:out value="${modulo.id}" />',getLeftMenu(),<%= topMenu %>,'submennu_r3_c1');">
            <td colspan="6" valign="top"><p style="margin:0px"></p></td>
            <td colspan="3"><a href="submenu.do?modulo=5" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('menu_r5_c7','','img/menu_r5_c7_f2.gif',1);"><img name="menu_r5_c7" src="img/menu_r5_c7.gif" width="53" height="15" border="0" id="menu_r5_c7" alt="" /></a></td><% topMenu += 15 + 14; %>
            <td colspan="6" valign="top"><p style="margin:0px"></p></td>
            <td><img src="img/spacer.gif" width="1" height="15" border="0" alt="" /></td>
          </tr>
        </c:if>
        <c:if test="${modulo.id == 1}" >
          <tr>
            <td colspan="15"><img name="menu_r6_c1" src="img/menu_r6_c1.gif" width="141" height="15" border="0" id="menu_r6_c1" alt="" /></td>
            <td><img src="img/spacer.gif" width="1" height="15" border="0" alt="" /></td>
          </tr>
          <tr onMouseOut="startTimeout(1000);" onMouseOver="showMenu('menu', 'submenu_0<c:out value="${modulo.id}" />',getLeftMenu(),<%= topMenu %>,'submennu_r3_c1');">
            <td colspan="2" valign="top"><p style="margin:0px"></p></td>
            <td colspan="11"><a href="submenu.do?modulo=1" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('menu_r7_c3','','img/menu_r7_c3_f2.gif',1);"><img name="menu_r7_c3" src="img/menu_r7_c3.gif" width="115" height="30" border="0" id="menu_r7_c3" alt="" /></a></td><% topMenu += 30 + 14; %>
            <td colspan="2" valign="top"><p style="margin:0px"></p></td>
            <td><img src="img/spacer.gif" width="1" height="30" border="0" alt="" /></td>
          </tr>
        </c:if>
        <c:if test="${modulo.id == 2}" >
          <tr>
            <td colspan="15"><img name="menu_r8_c1" src="img/menu_r8_c1.gif" width="141" height="12" border="0" id="menu_r8_c1" alt="" /></td>
            <td><img src="img/spacer.gif" width="1" height="12" border="0" alt="" /></td>
          </tr>
          <tr onMouseOut="startTimeout(1000);" onMouseOver="showMenu('menu', 'submenu_0<c:out value="${modulo.id}" />',getLeftMenu(),<%= topMenu %>,'submennu_r3_c1');">
            <td colspan="4" valign="top"><p style="margin:0px"></p></td>
            <td colspan="7"><a href="submenu.do?modulo=2" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('menu_r9_c5','','img/menu_r9_c5_f2.gif',1);"><img name="menu_r9_c5" src="img/menu_r9_c5.gif" width="70" height="12" border="0" id="menu_r9_c5" alt="" /></a></td><% topMenu += 12 + 14; %>
            <td colspan="4" valign="top"><p style="margin:0px"></p></td>
            <td><img src="img/spacer.gif" width="1" height="12" border="0" alt="" /></td>
          </tr>
        </c:if>
      </c:forEach>
      <tr>
        <td colspan="15"><img name="menu_r10_c1" src="img/menu_r10_c1.gif" width="141" height="12" border="0" id="menu_r10_c1" alt="" /></td>
        <td><img src="img/spacer.gif" width="1" height="12" border="0" alt="" /></td>
      </tr>
      <tr>
        <td valign="top"><p style="margin:0px"></p></td>
        <td colspan="13"><a href="javascript:;" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('menu_r11_c2','','img/menu_r11_c2_f2.gif',1);"><img name="menu_r11_c2" src="img/menu_r11_c2.gif" width="122" height="13" border="0" id="menu_r11_c2" alt="" /></a></td>
        <td valign="top"><p style="margin:0px"></p></td>
        <td><img src="img/spacer.gif" width="1" height="13" border="0" alt="" /></td>
      </tr>
      <tr>
        <td colspan="15"><img name="menu_r12_c1" src="img/menu_r12_c1.gif" width="141" height="15" border="0" id="menu_r12_c1" alt="" /></td>
        <td><img src="img/spacer.gif" width="1" height="15" border="0" alt="" /></td>
      </tr>
      <tr>
        <td colspan="7" valign="top"><p style="margin:0px"></p></td>
        <td><a href="salir.do" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('menu_r13_c8','','img/menu_r13_c8_f2.gif',1);"><img name="menu_r13_c8" src="img/menu_r13_c8.gif" width="26" height="14" border="0" id="menu_r13_c8" alt="" /></a></td>
        <td colspan="7" valign="top"><p style="margin:0px"></p></td>
        <td><img src="img/spacer.gif" width="1" height="14" border="0" alt="" /></td>
      </tr>
    </c:if>
    <c:if test="${user == null}" >
      <tr>
        <td colspan="15"><img name="menu_r2_c1" src="img/menu_r2_c1.gif" width="141" height="14" border="0" id="menu_r2_c1" alt="" /></td>
        <td><img src="img/spacer.gif" width="1" height="14" border="0" alt="" /></td>
      </tr>
      <tr>
        <td colspan="15" align="center" valign="top"><p style="margin:0px">
          <input name="login" type="text" id="login" value="usuario" size="10"/>
        </p></td>
        <td><img src="img/spacer.gif" width="1" height="15" border="0" alt="" /></td>
      </tr>
      <tr>
        <td colspan="15"><img name="menu_r2_c1" src="img/menu_r2_c1.gif" width="141" height="14" border="0" id="menu_r2_c1" alt="" /></td>
        <td><img src="img/spacer.gif" width="1" height="14" border="0" alt="" /></td>
      </tr>
      <tr>
        <td colspan="15" align="center" valign="top"><p style="margin:0px">
          <input name="passwd" type="password" id="passwd" value="passwd" size="10"/>
        </p></td>
        <td><img src="img/spacer.gif" width="1" height="15" border="0" alt="" /></td>
      </tr>
      <tr>
        <td colspan="15"><img name="menu_r2_c1" src="img/menu_r2_c1.gif" width="141" height="14" border="0" id="menu_r2_c1" alt="" /></td>
        <td><img src="img/spacer.gif" width="1" height="14" border="0" alt="" /></td>
      </tr>
      <tr>
        <td colspan="15" align="right" valign="top"><p style="margin:0px">
          <input name="ok" type="submit" id="ok" value="ok" size="10"/>
        &nbsp;&nbsp;&nbsp;&nbsp;</p></td>
        <td><img src="img/spacer.gif" width="1" height="15" border="0" alt="" /></td>
      </tr>
    </c:if>
  </table>
</form>
<div id="menu"> <% int j = 1; %>
<c:forEach var="modulo" items="${sessionScope.paginasModulo}"><%  int i = 0; %>
  <div id="submenu_<%= j %>" onMouseOut="startTimeout(1000);" onMouseOver="resetTimeout();" class="submenu_0"><table border="0" cellpadding="0" cellspacing="0"> 
  <c:forEach var="pagina" items="${modulo}"><c:set var="idModulo" value="${pagina.idModulo}" />
      <tr height="26"><td>
        <a href="<c:out value="${pagina.url}" />" id="submenu_0_Item" class="ItemSubMenu" onmouseover="overItem('submenu_0');"><c:out value="${pagina.nombre}" /></a></td></tr>
  </c:forEach><script language="javascript">changeName ( 'submenu_<%= j++ %>', 'submenu_0<c:out value="${idModulo}" />' );</script>
    </table></div>
</c:forEach>
</div>
